package FourArithmeticOperations;

import junit.framework.TestCase;

/**
 * Created by dell on 2017/10/18.
 */
public class LinkedQueueTest extends TestCase {
    LinkedQueue linkedQueue = new LinkedQueue();
    public void testDequeue() throws Exception {
        linkedQueue.enqueue("cai");
        linkedQueue.enqueue("wang");
        linkedQueue.enqueue("zhang");
        linkedQueue.dequeue();
        assertEquals("wang",linkedQueue.dequeue());
    }

    public void testFirst() throws Exception {
        linkedQueue.enqueue("cai");
        linkedQueue.enqueue("wang");
        linkedQueue.enqueue("zhang");
        linkedQueue.first();
        assertEquals("cai", linkedQueue.first());

    }

    public void testIsEmpty() throws Exception {
        linkedQueue.enqueue("cai");
        linkedQueue.enqueue("wang");
        linkedQueue.enqueue("zhang");
        assertEquals(false,linkedQueue.isEmpty());
    }

    public void testSize() throws Exception {
        linkedQueue.enqueue("cai");
        linkedQueue.enqueue("wang");
        linkedQueue.enqueue("zhang");
        assertEquals(3,linkedQueue.size());
    }

    public void testToString() throws Exception {
        linkedQueue.enqueue("cai");
        linkedQueue.toString();
     assertEquals("cai\n",linkedQueue.toString());
    }

}